---
apiVersion: v1
kind: Pod
metadata:
  name: netperf-server
  labels:
    id: netperf-server
    zgroup: testapp
spec:
  terminationGracePeriodSeconds: 0
  containers:
  - name: netperf
    image: docker.io/tgraf/netperf:v1.0
    readinessProbe:
      exec:
        command: ["netperf", "-H", "127.0.0.1", "-l", "1"]
      # This timeout needs to be higher than the time netperf command takes to
      # finish its execution
      timeoutSeconds: 5
---
apiVersion: v1
kind: Pod
metadata:
  name: netperf-client
  labels:
    id: netperf-client
    zgroup: testapp
spec:
  terminationGracePeriodSeconds: 0
  containers:
  - name: netperf
    image: docker.io/tgraf/netperf:v1.0
---
apiVersion: v1
kind: Service
metadata:
  name: netperf-service
spec:
  ports:
  - port: 12865
  selector:
    id: netperf-server
